import Vue from 'vue'
import Router from 'vue-router'

import Home from './views/Home.vue'
import Login from './views/Login.vue';
import NotFound from './views/404.vue'
import Main from './views/Main.vue'
import Table from './views/nav1/Table.vue'
import Form from './views/nav1/Form.vue'
import User from './views/nav1/user.vue'
Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [{
            path: '/',
            component: Home,
            name: '导航一',
            iconCls: 'el-icon-message', //图标样式class
            children: [
                {
                    path: '/main',
                    component: Main,
                    name: '主页',
                    hidden: true
                },
                {
                    path: '/table',
                    component: Table,
                    name: '表格组件',
                
                },
                {
                    path: '/form',
                    component: Form,
                    name: '表单上传',
                 
                },
                {
                    path: '/user',
                    component: User,
                    name: '用户列表',
                   
                },
            ]
        },
        {
            path: '/',
            component: Home,
            name: '导航二',
            iconCls: 'el-icon-user-solid', //图标样式class
            // children: [

            // ]
        },
        {
            path: '/login',
            name: 'Login',
            component: Login,
            hidden: true
        },
        {
            path: '/404',
            component: NotFound,
            name: '',
            hidden: true
        },
        {
            path: '*',
            hidden: true,
            redirect: {
                path: '/404'
            }
        }
        // {
        //   path: '/about',
        //   name: 'about',
        //   // route level code-splitting
        //   // this generates a separate chunk (about.[hash].js) for this route
        //   // which is lazy-loaded when the route is visited.
        //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
        // },
    ]
})
